<?php


namespace App\Common\Http\Request;


use Hyperf\Validation\Request\FormRequest;

class MeetingTplCreateRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     */
    public function authorize(): bool
    {
        return true;
    }


    /**
     * Get the validation rules that apply to the request.
     */
    public function rules(): array
    {
        return [
            'title' => 'required|between:3,100',
            'content' => 'required',
            'userLimit' => 'required|integer|min:0',
            'signType' => 'in:1,2,3,4',
            'signRules' => 'required',
            'status' => 'in:-1,0,1',
        ];
    }

    public function messages(): array
    {
        return [
            'title.required' => '标题必填',
            'title.between' => '标题长度在3~100之间',
            'content.required' => '内容必填',
            'userLimit.required' => '人数限制必填',
            'userLimit.integer' => '人数必须是整数',
            'userLimit.min' => '人数最小是0',
            'signType.in' => '请正确选择签到类型',
            'signRules.required' => '签到规则必填',
            'status.in' => '请正确选择发布状态'
        ];
    }
}
